###readme.txt

This folder contains the replication files for Enos, Ryan D. and Eitan D. Hersh. 2015. ""Party Activists as Campaign Advertisers: The Ground Campaign as a Principal-Agent Problem,"� American Political Science Review 109 (2):252-278.

***To replicate this manuscript*** 
run "EnosHershReplication.r" by typing "source('EnosHershReplication.r')" into the R terminal.  This will use pre-processed data to output all figures, tables, and other tests in the manuscript and appendix.
***NOTE***
This .r file will generate warning messages in R.  These warning messages are expected and are related to the drawing of arrows in the transitionPlot() function.  
 
**Output is in a the directory "output," and should be 19 figures, four tables, and one .txt file.  The .txt file, "r_output.txt," outputs all quantitative information in the paper that is not included in a figure or table.   
	
**Prior to executing the scripts, the R terminal should be pointed to the folder "EnosHershReplication", which can be accomplished by typing "setwd('../EnosHershReplication')" where ".." is the local file structure where "EnosHershReplication" is located.

These files require the R programming language, which can be downloaded here: http://www.r-project.org/

You execute EnosHershReplication.r, you may need to install the packages used, this can be accomplished by typing the following in the R terminal:
install.packages("foreign")
install.packages("gdata")
install.packages("RColorBrewer")
install.packages("MatchIt")  
install.packages("nlme")
install.packages("xtable")
install.packages("Rmisc")
install.packages("maptools")
install.packages("raster")
install.packages("rgdal")
install.packages("colorspace")
install.packages("gplots")
install.packages("epicalc")
install.packages("Gmisc")
install.packages("grid")

Questions? Please contact Ryan Enos (renos@gov.harvard.edu).


**************************************************************
***There are three .Rdata objects included in the directory.  Descriptions of the files and the variables are below.   

***'USA_adm1.RData'***
These are shape files of United States states from www.gadm.org in R data format.

***'USA_adm2.RData'***
These are shape files of United States counties from www.gadm.org in R data format.

***'EnosHershData.RData'***
This is an R data file which includes five data frames, each is described below:
*CCAP.com.dat: data from the 2012 Cooperative Campaign Analysis Project common dataset:
	"liberal.all": self-reported liberal ideology, including "very liberal" 0/1 
	"moderate": self-reported moderate ideology 0/1             
	"vote.2010": did the respondent vote in 2010? 0/1              
	"female": is the respondent female? 0/1                
	"white": is the respondent white? 0/1                  
	"black": is the respondent Black? 0/1                
	"hispanic": is the respondent Hispanic? 0/1               
	"college.track": is the respondent in college and/or a college graduate? 0/1         
	"non.church": does the respondent not attend church? 0/1             
	"income.recode": respondent annual income         
	"age": respondent age
	"strong.dem": is the respondent a self-reported 'strong Democrat'? 0/1 
	"state": respondent state
	"pro.choice": is the respondent "pro choice" on the issue of abortion? 0/1
	"affirmative.action": is the respondent in favor of race-based affirmative action? 0/1
	"global.warming.believe": does the respondent believe that humans are responsible for global warming? 0/1
	"gay.marriage": does the respondent believe that gay marriage should be legal? 0/1
	"dem" is the respondent a self-reported Democrat?
	"undecided" is the respondent a self-reported undecided voter for President in 2012?           

*CCES.dat*: data from the 2012 Cooperative Congressional Election Study, Yale Supplement:
	"YAL321": what issue does the respondent believe is most important to other voters?
	"dem": is the respondent a self-reported Democrat? 0/1       "rep": is the respondent a self-reported Republican? 0/1       "undecided": is the respondent a self-reported undecided voter for President in 2012?           
	"educ": what is the highest level of education completed by the respondent?
	
*GCP.dat: data from the Ground Campaign Project:
	"v1": Respondent ID
	"strategy": "How would you characterize the campaign�s main strategy at the present time in your area? Select all that apply." 1 if selected, NA otherwise
		"strategy_1": "Paid advertisement geared at persuading undecided voters"
        "strategy_2": "Paid advertisement geared at mobilizing supporters"
        "strategy_3": "Volunteer Field Contact geared at persuading undecided voters"
		"strategy_4": "Volunteer Field Contact geared at mobilizing supporters"
        "strategy_5": "Registering voters"
		"strategy_6": "Recruiting voters through social networks (i.e. contacting friends and colleagues)"
		"strategy_7": "Building party support"
        "strategy_8": "Other"
    "liberal.all": self-reported liberal ideology, including "very liberal" 0/1 
	"very.liberal": self-reported "very liberal" 0/1
	"moderate": self-reported "moderate" 0/1
	"strong.partisan": self-reported "strong Democrat" or "strong Republican" 0/1
	"vote.2010": did the worker vote in 2010? 0/1              
	"female": is the worker female? 0/1                
	"white": is the worker white? 0/1                  
	"black": is the worker Black? 0/1                
	"hispanic": is the worker Hispanic? 0/1               
	"college.track": is the worker in college and/or a college graduate? 0/1         
	"non.church": does the worker not attend church? 0/1             
	"income.recode": worker annual income         
	"age": worker age
	"strong.dem": is the worker a self-reported 'strong Democrat'? 0/1 
	"state": state in which worker is campaigning (abbreviation)
	"voter_iss.rc": what issue does the worker believe is most important to voters?
	"most_imp.rc":  issue most important to worker       
	"inv_camp": "How did you first get involved with the campaign?" A friend or family member asked me to join them (1), I contacted the campaign and asked to volunteer (3), The campaign contacted me and asked me to volunteer (4), I was recruited as a paid staffer (5), Other (6)
  	"camp_role": ""How would you describe your role in the campaign?" Volunteer (1), Intern (2), Paid Campaign Staff (4), Other � please specify (5) 
    "voters": ""What percentage of your time on the campaign do you spend directly interacting with voters?" 0-24% (1), 25-49%  (2), 50-74% (3), 75-100% (4)
	"ideology.recode.1": self-reported ideology: Very Liberal (1), Liberal (2), Moderate (3), Conservative (4), Very Conservative (5)
	"camp.state": state in which worker is campaigning (abbreviation)
	"perm.state": state in which worker permanently lives (abbreviation)
	"fullstartdate": GCP survey date
	"committee": campaign committee        
	"time.rc": hours working on campaign per week          
	
*stack.dat: combined common content from 2012 CCAP and CCES
	"ideology.recode.1": self-reported ideology: Very Liberal (1), Liberal (2), Moderate (3), Conservative (4), Very Conservative (5)
	"state": respondent state (abbreviation)
	"very.liberal": self-reported "very liberal" 0/1
	"moderate": self-reported "moderate" 0/1
	"strong.partisan": self-reported "strong Democrat" or "strong Republican" 0/1
	"vote.2010": did the respondent vote in 2010? 0/1              
	"female": is the respondent female? 0/1                
	"white": is the respondent white? 0/1                  
	"black": is the respondent Black? 0/1                
	"hispanic": is the respondent Hispanic? 0/1               
	"college.track": is the respondent in college and/or a college graduate? 0/1         
	"non.church": does the respondent not attend church? 0/1             
	"income.recode": respondent annual income         
	"age": respondent age
	"undecided" is the respondent a self-reported undecided voter for President in 2012?           
	"dem" is the respondent a self-reported Democrat?

*vote.dat: table of popular vote share for Democratic candidate in Presidential selections, 1960 to 2012.  